package com.hb0730.boot.admin.modules.sys.system.controller;
import com.hb0730.boot.admin.base.R;
import com.hb0730.boot.admin.data.domain.BasePage;
import com.hb0730.boot.admin.modules.sys.system.model.entity.SysDepartment;
import com.hb0730.boot.admin.modules.sys.system.model.entity.SysRole;
import com.hb0730.boot.admin.modules.sys.system.model.query.RoleQuery;
import com.hb0730.boot.admin.modules.sys.system.service.SysDepartmentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sys/dep")
@Tag(name = "系统：用户管理")
@RequiredArgsConstructor
public class SysDepController {

    private final SysDepartmentService sysDepartmentService;

    @GetMapping("/list")
    @Operation(summary = "查询院系部门")
    public R<List<SysDepartment>> queryPage() {
        List<SysDepartment> departmentList = sysDepartmentService.findAll();
        return R.OK(departmentList);
    }
}
